<!DOCTYPE html>
<html lang="en">
<head>
    <title>欢迎访问逐光智慧伴学系统</title>
    <meta name="viewport" content="width=device-width, initial-scale=1"/>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta name="keywords"
          content="Transparent Sign In Form Responsive Widget,Login form widgets, Sign up Web forms , Login signup Responsive web form,Flat Pricing table,Flat Drop downs,Registration Forms,News letter Forms,Elements"/>
    <script type="application/x-javascript">
        addEventListener("load", function () {
            setTimeout(hideURLbar, 0);
        }, false);

        function hideURLbar() {
            window.scrollTo(0, 1);
        }
    </script>
    <script src="../static/js/jquery-1.9.1.min.js"></script>
    <link rel="stylesheet" href="../static/css/font-awesome.css"/> <!-- Font-Awesome-Icons-CSS -->
    <link rel="stylesheet" href="../static/css/login.css" type="text/css" media="all"/> <!-- Style-CSS -->
    <link rel="stylesheet" href="../static/js/plugins/layer/skin/layer.css"/>
    <script src="../static/js/plugins/layer/layer.js"></script>
    <script>
        $(function() {
            //给登录按钮绑定点击事件
            $("#btn1").click(function() {
                $.ajax({
                    url: "/user/save",
                    type: "post",
                    data: $("#loginForm").serialize(),
                    success: function (r) {
                        if (r.code == 0) {
                            layer.msg(r.msg);
                            location.href = "/";
                        } else {
                            layer.msg(r.msg);
                        }
                    }
                });
            });
        })
        function isCom(){
            var text1= document.getElementById("password").value;
            var text2= document.getElementById("password2").value;
            if (text2 == text1){
                document.getElementById("pwd2Span").innerHTML = "";
                return true;
            }else {
                document.getElementById("pwd2Span").innerHTML = "两次输入的密码不一致";
                return false;
            }
        }
    </script>
</head>
<body style="background-image: url('/static/img/bg.jpg')">
<div class="header-w3l">
    <h1>逐光智慧伴学系统用户注册</h1>
</div>
<div class="main-content-agile">
    <div class="sub-main-w3">
        <form id="loginForm">
            <div class="icon2">
                <input placeholder="用户名" id="username" name="username" type="text"/>
            </div>
            <div class="icon2">
                <input placeholder="密码" id="password" name="password" type="password"onblur="isCom()"/>
            </div>
            <div class="icon2">
                <input placeholder="确认密码" id="password2" type="password"onblur="isCom()"/>
            </div>
            <span id="pwd2Span" style="color: lightcoral;font-size: 3px"></span></p>
            <div class="clear"></div>
            <input  type="button" style="width: 240px;" id="btn1" value="注册">
            <div class="icon1">
                <span id="err_msg" style="color: red; "></span>
            </div>
        </form>
        <a class="login_a" href="/">已有账号？点击登录！</a>
    </div>
</div>
</body>
</html>
